package edu.ccut.titan.tag.report.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import edu.ccut.titan.tag.report.design.CellInfo;
import edu.ccut.titan.tag.report.design.FooterInfo;

public class TitanReportFooterTag extends TagSupport {
	private static final long serialVersionUID = 5926977096632331461L;
	private String value;
	private String title;
	private String height;
	private String width;
	private TitanReportTag reportTag;
	private FooterInfo footerInfo;

	@Override
	public int doStartTag() throws JspException {
		reportTag = (TitanReportTag) this.getParent();
		footerInfo = new FooterInfo();
		return EVAL_BODY_INCLUDE;
	}

	@Override
	public int doEndTag() throws JspException {
		footerInfo.setHeight(height);
		footerInfo.setTitle(title);
		footerInfo.setValue(value);
		footerInfo.setWidth(width);
		reportTag.addFooterInfo(footerInfo);
		return SKIP_BODY;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getHeight() {
		return height;
	}

	public void setHeight(String height) {
		this.height = height;
	}

	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

}
